#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    int gai = 0;
    for (int i = n; i > 0; i--) {
        gai++;
        if (gai == 3) {
            gai = 0;
            n++;
            i++;
        }
    }
    printf("%d", n);
    return 0;
}